package com.itheima.day08.kebiancanshu;

import java.math.BigDecimal;

public class Tets {
    public static double sum(double...x){
        BigDecimal X = BigDecimal.valueOf(0);

        for (int i = 0; i < x.length; i++) {
            BigDecimal Z = BigDecimal.valueOf(x[i]);
            X = X.add(Z);
        }
        double y = X.doubleValue();
        return y;
    };

    public static void main(String[] args) {
        System.out.println(sum(1,2,3,4,5));
    }
}
